package com.xyazm.order.mq.producer;

import com.xyazm.common.enums.RocketMqTopicEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.TransactionMQProducer;
import org.apache.rocketmq.spring.autoconfigure.RocketMQProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 取消订单流程发送前置准备工作producer组件
 * @author xuyou
 * 2022-12-01 22:09
*/
@Slf4j
@Component
public class CancelOrderSendPreparationProducer extends AbstractTransactionProducer {


    @Autowired
    public CancelOrderSendPreparationProducer(RocketMQProperties rocketMQProperties) {
        producer = new TransactionMQProducer(RocketMqTopicEnum.ACTUAL_REFUND.getProducerGroup());
        producer.setNamesrvAddr(rocketMQProperties.getNameServer());
        start();
    }

}
